Description
On startup, detect macOS Dark Mode and choose the matching theme variant automatically, rather than always defaulting to flexoki.
Detection:
import subprocess
result = subprocess.run(
["defaults", "read", "-g", "AppleInterfaceStyle"],
capture_output=True, text=True
)
is_dark = result.returncode == 0 and "Dark" in result.stdout
Startup behavior:
- If state file (TASK-021) has a saved theme: use it as-is (user explicitly chose it)
- If no saved theme: pick
flexoki-darkwhen Dark Mode is on,flexokiwhen off tcycling still works normally and saves to state file- A
--no-auto-themeCLI flag or constant at top of file disables this behavior
Acceptance Criteria
- #1 First launch with no saved theme picks dark variant in Dark Mode, light variant otherwise
- #2 Saved theme from state file takes priority over auto-detection
- #3 Detection failure (non-macOS, permission error) falls back to flexoki silently
- #4 Auto-detection runs synchronously before the app loop starts (no flash of wrong theme)